
<h1><span class="yiyi-st" id="yiyi-13">numpy.ma.MaskedArray.argsort</span></h1>
        <blockquote>
        <p>原文：<a href="https://docs.scipy.org/doc/numpy/reference/generated/numpy.ma.MaskedArray.argsort.html">https://docs.scipy.org/doc/numpy/reference/generated/numpy.ma.MaskedArray.argsort.html</a></p>
        <p>译者：<a href="https://github.com/wizardforcel">飞龙</a> <a href="http://usyiyi.cn/">UsyiyiCN</a></p>
        <p>校对：（虚位以待）</p>
        </blockquote>
    
<dl class="method">
<dt id="numpy.ma.MaskedArray.argsort"><span class="yiyi-st" id="yiyi-14"> <code class="descclassname">MaskedArray.</code><code class="descname">argsort</code><span class="sig-paren">(</span><em>axis=None</em>, <em>kind=&apos;quicksort&apos;</em>, <em>order=None</em>, <em>fill_value=None</em><span class="sig-paren">)</span><a class="reference external" href="http://github.com/numpy/numpy/blob/v1.11.3/numpy/ma/core.py#L5206-L5257"><span class="viewcode-link">[source]</span></a></span></dt>
<dd><p><span class="yiyi-st" id="yiyi-15">返回沿指定轴对数组进行排序的索引数组。</span><span class="yiyi-st" id="yiyi-16">屏蔽值预先填充到<a class="reference internal" href="../maskedarray.baseclass.html#numpy.ma.MaskedArray.fill_value" title="numpy.ma.MaskedArray.fill_value"><code class="xref py py-obj docutils literal"><span class="pre">fill_value</span></code></a>。</span></p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name">
<col class="field-body">
<tbody valign="top">
<tr class="field-odd field"><th class="field-name"><span class="yiyi-st" id="yiyi-17">参数：</span></th><td class="field-body"><p class="first"><span class="yiyi-st" id="yiyi-18"><strong>axis</strong>：int，可选</span></p>
<blockquote>
<div><p><span class="yiyi-st" id="yiyi-19">要排序的轴。</span><span class="yiyi-st" id="yiyi-20">默认值为-1（最后一个轴）。</span><span class="yiyi-st" id="yiyi-21">如果为“无”，则使用展平的数组。</span></p>
</div></blockquote>
<p><span class="yiyi-st" id="yiyi-22"><strong>fill_value</strong>：var，可选</span></p>
<blockquote>
<div><p><span class="yiyi-st" id="yiyi-23">用于在排序之前填充数组的值。</span><span class="yiyi-st" id="yiyi-24">默认值为输入数组的<a class="reference internal" href="../maskedarray.baseclass.html#numpy.ma.MaskedArray.fill_value" title="numpy.ma.MaskedArray.fill_value"><code class="xref py py-obj docutils literal"><span class="pre">fill_value</span></code></a>属性。</span></p>
</div></blockquote>
<p><span class="yiyi-st" id="yiyi-25"><strong>kind</strong>：{&apos;quicksort&apos;，&apos;mergesort&apos;，&apos;heapsort&apos;}，可选</span></p>
<blockquote>
<div><p><span class="yiyi-st" id="yiyi-26">排序算法。</span></p>
</div></blockquote>
<p><span class="yiyi-st" id="yiyi-27"><strong>订单</strong>：list，可选</span></p>
<blockquote>
<div><p><span class="yiyi-st" id="yiyi-28">当<em class="xref py py-obj">a</em>是定义了字段的数组时，此参数指定首先，第二等比较哪些字段。</span><span class="yiyi-st" id="yiyi-29">不需要指定所有字段。</span></p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name"><span class="yiyi-st" id="yiyi-30">返回：</span></th><td class="field-body"><p class="first"><span class="yiyi-st" id="yiyi-31"><strong>index_array</strong>：ndarray，int</span></p>
<blockquote class="last">
<div><p><span class="yiyi-st" id="yiyi-32">沿指定轴排序<em class="xref py py-obj">a</em>的指数数组。</span><span class="yiyi-st" id="yiyi-33">换句话说，<code class="docutils literal"><span class="pre">a[index_array]</span></code>产生一个排序的<em class="xref py py-obj">a</em>。</span></p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
<div class="admonition seealso">
<p class="first admonition-title"><span class="yiyi-st" id="yiyi-34">也可以看看</span></p>
<dl class="last docutils">
<dt><span class="yiyi-st" id="yiyi-35"><a class="reference internal" href="numpy.ma.sort.html#numpy.ma.sort" title="numpy.ma.sort"><code class="xref py py-obj docutils literal"><span class="pre">sort</span></code></a></span></dt>
<dd><span class="yiyi-st" id="yiyi-36">描述使用的排序算法。</span></dd>
<dt><span class="yiyi-st" id="yiyi-37"><code class="xref py py-obj docutils literal"><span class="pre">lexsort</span></code></span></dt>
<dd><span class="yiyi-st" id="yiyi-38">使用多个键的间接稳定排序。</span></dd>
<dt><span class="yiyi-st" id="yiyi-39"><code class="xref py py-obj docutils literal"><span class="pre">ndarray.sort</span></code></span></dt>
<dd><span class="yiyi-st" id="yiyi-40">排序排序。</span></dd>
</dl>
</div>
<p class="rubric"><span class="yiyi-st" id="yiyi-41">笔记</span></p>
<p><span class="yiyi-st" id="yiyi-42">有关不同排序算法的说明，请参见<a class="reference internal" href="numpy.ma.sort.html#numpy.ma.sort" title="numpy.ma.sort"><code class="xref py py-obj docutils literal"><span class="pre">sort</span></code></a>。</span></p>
<p class="rubric"><span class="yiyi-st" id="yiyi-43">例子</span></p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">a</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">ma</span><span class="o">.</span><span class="n">array</span><span class="p">([</span><span class="mi">3</span><span class="p">,</span><span class="mi">2</span><span class="p">,</span><span class="mi">1</span><span class="p">],</span> <span class="n">mask</span><span class="o">=</span><span class="p">[</span><span class="kc">False</span><span class="p">,</span> <span class="kc">False</span><span class="p">,</span> <span class="kc">True</span><span class="p">])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">a</span>
<span class="go">masked_array(data = [3 2 --],</span>
<span class="go">             mask = [False False  True],</span>
<span class="go">       fill_value = 999999)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">a</span><span class="o">.</span><span class="n">argsort</span><span class="p">()</span>
<span class="go">array([1, 0, 2])</span>
</pre></div>
</div>
</dd></dl>
